package com.vueperson.vueperson.t1.CreationalPattern.PrototypePattern.PrototypeManager;

public class Client {
    public static void main(String[] args) {
        PrototypeManager prototypeManager=PrototypeManager.getInstance();

        ConcretePrototypeA concretePrototypeA=new ConcretePrototypeA();
        concretePrototypeA.setAttr("A1");
        System.out.println(concretePrototypeA);
        ConcretePrototypeA copyA= (ConcretePrototypeA) prototypeManager.get("A");
        copyA.setAttr("A2");
        System.out.println(copyA);
        System.out.println(concretePrototypeA);
        System.out.println(prototypeManager);

        ConcretePrototypeB b=new ConcretePrototypeB();
        b.setName("B1");
        System.out.println(b);

        ConcretePrototypeB copyB= (ConcretePrototypeB) prototypeManager.get("B");
        copyB.setName("B2");
        System.out.println(copyB);
        System.out.println(b);
        System.out.println(prototypeManager);


    }
}
